package com.jd.order.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.jd.basic.service.impl.BaseServiceImpl;
import com.jd.basic.util.AjaxResult;
import com.jd.order.domain.OrderAdopt;
import com.jd.order.mapper.OrderAdoptMapper;
import com.jd.order.service.IOrderAdoptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * 业务实现类：
 */
@Service
public class OrderAdoptServiceImpl extends BaseServiceImpl<OrderAdopt> implements IOrderAdoptService {
    @Autowired
    private OrderAdoptMapper orderAdoptMapper;
    @Override
    public AjaxResult submitOrder(OrderAdopt orderAdopt) {
        // 添加表
        orderAdopt.setOrderSn(RandomUtil.randomNumbers(10));
        orderAdopt.setPaySn(RandomUtil.randomNumbers(15));
        orderAdopt.setLastPayTime(new Date(System.currentTimeMillis()));
        orderAdoptMapper.add(orderAdopt);
        return new AjaxResult();
    }
}
